/**
 * 
 */
package com.fsoft.tinhcd.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @author caodangtinh
 * 
 */
@Entity
@Table(name = "employee", schema = "hibernate")
public class Employee {
	private int employeeId;
	private String firstName;
	private String lastName;
	private Date birthDate;
	private String cellPhone;
	private EmployeeDetails employeeDetails;

	public Employee() {
	}

	/**
	 * @param firstName
	 * @param lastName
	 * @param birthDate
	 * @param cellPhone
	 */
	public Employee(String firstName, String lastName, Date birthDate,
			String cellPhone) {
		super();
		this.firstName = firstName;
		this.lastName = lastName;
		this.birthDate = birthDate;
		this.cellPhone = cellPhone;
	}

	/**
	 * @param firstName
	 * @param lastName
	 * @param birthDate
	 * @param cellPhone
	 * @param employeeDetails
	 */
	public Employee(String firstName, String lastName, Date birthDate,
			String cellPhone, EmployeeDetails employeeDetails) {
		super();
		this.firstName = firstName;
		this.lastName = lastName;
		this.birthDate = birthDate;
		this.cellPhone = cellPhone;
		this.employeeDetails = employeeDetails;
	}

	/**
	 * @return the employeeId
	 */
	@Id
	@GeneratedValue
	@Column(name = "EMPLOYEE_ID", nullable = false, unique = true)
	public int getEmployeeId() {
		return employeeId;
	}

	/**
	 * @param employeeId
	 *            the employeeId to set
	 */
	public void setEmployeeId(int employeeId) {
		this.employeeId = employeeId;
	}

	/**
	 * @return the firstName
	 */
	@Column(name = "FIRST_NAME", length = 50, nullable = false)
	public String getFirstName() {
		return firstName;
	}

	/**
	 * @param firstName
	 *            the firstName to set
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * @return the lastName
	 */
	@Column(name = "LAST_NAME", nullable = false, length = 50)
	public String getLastName() {
		return lastName;
	}

	/**
	 * @param lastName
	 *            the lastName to set
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	/**
	 * @return the birthDate
	 */
	@Column(name = "BIRTH_DATE", nullable = false)
	public Date getBirthDate() {
		return birthDate;
	}

	/**
	 * @param birthDate
	 *            the birthDate to set
	 */
	public void setBirthDate(Date birthDate) {
		this.birthDate = birthDate;
	}

	/**
	 * @return the cellPhone
	 */
	@Column(name = "CELL_PHONE", nullable = false)
	public String getCellPhone() {
		return cellPhone;
	}

	/**
	 * @param cellPhone
	 *            the cellPhone to set
	 */
	public void setCellPhone(String cellPhone) {
		this.cellPhone = cellPhone;
	}

	/**
	 * @return the employeeDetails
	 */
	@OneToOne(mappedBy = "employee", cascade = CascadeType.ALL)
	public EmployeeDetails getEmployeeDetails() {
		return employeeDetails;
	}

	/**
	 * @param employeeDetails
	 *            the employeeDetails to set
	 */
	public void setEmployeeDetails(EmployeeDetails employeeDetails) {
		this.employeeDetails = employeeDetails;
	}

}
